﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Web.Mvc;
using System.Threading;
using System.Globalization;
using System.Reflection;
using ASC.Resources;
using System.Data;

namespace ASC.Attributes
{
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public class SubmitButtonAttribute : ActionNameSelectorAttribute
    {
        public override bool IsValidName(ControllerContext controllerContext, string actionName, MethodInfo methodInfo)
        {

            var action = controllerContext.HttpContext.Request.Params.AllKeys.FirstOrDefault(x => x == "Action." + methodInfo.Name);
            return action != null;

        }
    }
}